package org.sdfc.model.attr

/** Represents the type of an Attribute.
 */
abstract sealed class AttrType {
  
  /** Tests if the Attribute is repeating. */
  def isRepeating : Boolean
  
}


/** Refinement of AttrType for SingleAttribute.
 */
abstract class SingleAttrType extends AttrType {
  
  /** False, by definition of this. */
  final def isRepeating = false
  
}

/** Refinement of AttrType for RepeatingAttribute.
 */
abstract class RepeatingAttrType extends AttrType {
  
  /** True, by definition of this. */
  final def isRepeating = true
  
}


/** single/boolean AttrType
 */
case object SingleBooleanAttrType extends SingleAttrType

/** single/int AttrType
 */
case object SingleIntAttrType extends SingleAttrType

/** single/string AttrType
 */
case object SingleStringAttrType extends SingleAttrType

/** single/id AttrType
 */
case object SingleIdAttrType extends SingleAttrType

/** single/time AttrType
 */
case object SingleTimeAttrType extends SingleAttrType

/** single/double AttrType
 */
case object SingleDoubleAttrType extends SingleAttrType


/** repeating/boolean AttrType
 */
case object RepeatingBooleanAttrType extends RepeatingAttrType

/** repeating/int AttrType
 */
case object RepeatingIntAttrType extends RepeatingAttrType

/** repeating/string AttrType
 */
case object RepeatingStringAttrType extends RepeatingAttrType

/** repeating/id AttrType
 */
case object RepeatingIdAttrType extends RepeatingAttrType

/** repeating/time AttrType
 */
case object RepeatingTimeAttrType extends RepeatingAttrType

/** repeating/double AttrType
 */
case object RepeatingDoubleAttrType extends RepeatingAttrType

